package LuoGu;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int m=s.nextInt();
        int[] arr=new int[n];
        for(int i=0;i<m;i++){
            arr[s.nextInt()-1]++;
        }
        StringBuilder sb=new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            while(arr[i]--!=0){
                sb.append((i+1)+" ");
            }
        }

        System.out.println(sb);
    }
}
